package com.lxlg.lxlg_order.infra.mapper;

import com.lxlg.lxlg_order.infra.model.DayStatement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lxlg.lxlg_order.infra.model.parm.DayStatementInfo;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author kevin
 * @since 2022-04-28
 */
public interface DayStatementMapper extends BaseMapper<DayStatement> {
    @Select("SELECT sku_id ,SUM(day_statement_price) , SUM(day_statement_salenum) , merchant_name,day_statement_merchant_id  FROM day_statement\n" +
            "where day_statement_time <#{endtTime}  And day_statement_time >#{startTime}\n" +
            "GROUP BY sku_id ,day_statement_merchant_id ,merchant_name")
    List<DayStatementInfo> getDayStatement(Date startTime, Date endtTime);
}
